package com.zzx.threekingdom.card;

import com.zzx.threekingdom.card.Pattern.Color;
import com.zzx.threekingdom.card.Pattern.Points;

public class KnowhowCard extends PatternCard
{
    public enum KnowhowCardType
    {
        lightning, leaveallbehind, impeccable, getknifetokill, harvest, outofnothing, duel, allpeach
            , alieninvade, swarmofarrows, steal, remove, NA
    }
    
    public static String type2String(KnowhowCardType type)
    {
        switch(type)
        {
            case lightning: return "闪电";
            case leaveallbehind: return "乐不思蜀";
            case impeccable: return "无懈可击";
            case getknifetokill: return "借刀杀人";
            case harvest: return "五谷丰登";
            case outofnothing: return "无中生有";
            case duel: return "决斗";
            case allpeach: return "桃园结义";
            case alieninvade: return "南蛮入侵";
            case swarmofarrows: return "万箭齐发";
            case steal: return "顺手牵羊";
            case remove: return "过河拆桥";
        }
        return "";
    }
    
    public static KnowhowCardType string2Type(String name)
    {
        if(name==null||name.length()==0)
            return KnowhowCardType.NA;
        if(name.equals("闪电"))
            return KnowhowCardType.lightning;
        else if(name.equals("乐不思蜀"))
            return KnowhowCardType.leaveallbehind;
        else if(name.equals("无懈可击"))
            return KnowhowCardType.impeccable;
        else if(name.equals("借刀杀人"))
            return KnowhowCardType.getknifetokill;
        else if(name.equals("五谷丰登"))
            return KnowhowCardType.harvest;
        else if(name.equals("无中生有"))
            return KnowhowCardType.outofnothing;
        else if(name.equals("决斗"))
            return KnowhowCardType.duel;
        else if(name.equals("桃园结义"))
            return KnowhowCardType.allpeach;
        else if(name.equals("南蛮入侵"))
            return KnowhowCardType.alieninvade;
        else if(name.equals("万箭齐发"))
            return KnowhowCardType.swarmofarrows;
        else if(name.equals("顺手牵羊"))
            return KnowhowCardType.steal;
        else if(name.equals("过河拆桥"))
            return KnowhowCardType.remove;
        else
            return KnowhowCardType.NA;
    }
    
    
    public KnowhowCardType mKnowhowCardType;
    
    
    public KnowhowCard(KnowhowCardType type, Color color, Points points)
    {
        super(color, points);
        mKnowhowCardType = type;
        setTextAndMap(type2String(type));
    }
    
    public KnowhowCardType getKonwhowType() { return mKnowhowCardType; }

}
